package com.wanqian.redis.service;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * @Author: wanqian
 * @Date: 2021/3/15 14:32
 */
@Service
public class SubService {

    @Transactional
    @JmsListener(destination = "${queueName}", containerFactory = "durableListenerContainerFactory")
    public void sub(TextMessage textMessage) throws JMSException {
        System.out.println(textMessage.getText());

    }
}
